<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function submitMe(_my_form)
{
  var xmlhttp=null;
  var message="personName="+_my_form.elements["personName"].value+"&dream="+_my_form.elements["dream"].value;
  if(window.XMLHttpRequest){
    xmlhttp=new XMLHttpRequest();
  }else{
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  var the_URL="PostAjax.jsp";
  if(xmlhttp) {  
    xmlhttp.open("POST",the_URL);
	xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
	xmlhttp.onreadystatechange=function(){
	  if(xmlhttp.readyState==4){
	    document.getElementById("display").innerHTML=xmlhttp.responseText;
	    document.getElementById("text1").innerHTML=xmlhttp.responseXML;
	  }
	}
	xmlhttp.send(message);
  }else{
    alert("Update browser");
  }
}
</script>
</head>

<body>
<h1>Make your Dream Unchaging</h1>
<div id="display">
<form>
Your name:<input name="personName" type="text"/><br />
Your favorite Dream:<br />
<textarea name="dream" rows="20" cols="40" ></textarea>
<br />
<input type="button" value="Send your dream" onclick="submitMe(this.form)"/>
</form>
</div>
<div id="text1"></div>
</body>
</html>
